package org.xteam.camllight.io;

import org.xteam.camllight.Atom;
import org.xteam.camllight.Primitive;
import org.xteam.camllight.Value;

public class OutputPrimitive implements Primitive {

	@Override
	public Object exec(Object... args) {
		Channel channel = (Channel) args[0];
		String buff = (String) args[1];
		int start = Value.longVal((Integer) args[2]);
		int length = Value.longVal((Integer) args[3]);
		channel.putblock(buff.getBytes(), start, length);
		return Atom.get(0);
	}

}
